package com.lanyun.yebdemo.controller;

import com.lanyun.yebdemo.bean.Article;
import com.lanyun.yebdemo.service.IArticlesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/articles")
public class ArticlesController {

    @Autowired
    IArticlesService articlesService;

    @GetMapping("/getall")
    public List<Article> getArticles(){
        return articlesService.getArticles();
    }

}
